import request from '@/utils/request'

export function login(data) {
  return request({
    url: 'user/adminLogin',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-element-admin/user/logout',
    method: 'post'
  })
}
export function condition(data) {
  return request({
    url: '/user/condition',
    method: 'post',
    data
  })
}

export function levelDown(id) {
  return request({
    url: `/user/downLevel/${id}`,
    method: 'put'
  })
}
export function levelUp(id) {
  return request({
    url: `/user/upLevel/${id}`,
    method: 'put'
  })
}

export function ban(id) {
  return request({
    url: `/user/ban/${id}`,
    method: 'put'
  })
}
export function unban(id) {
  return request({
    url: `/user/unBan/${id}`,
    method: 'put'
  })
}


export function findCount() {
  return request({
    url: '/user/findCount',
    method: 'get'
  })
}